import java.util.Scanner;
import java.util.*;

public class MC0313最佳邻居 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        // code here
        int n = input.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
        }
        long max = -1;//人数最大值
        int besStartIndex = 1;//相邻数
        //如果n小于4直接相加
        if (n<4){
            long count = 0;
            for (int var : arr){
                count+=var;
            }
            max = count;
            //否则使用滑动窗口
        }else{
            long currentWindowSum = 0;
            // 1. 初始化第一个窗口
            for (int i = 0; i < 4; i++) {
//                currentWindowSum = arr[0] + arr[1] + arr[2] + arr[3]
//                        = 7 + 14 + 0 + 9 = 30
                currentWindowSum+=arr[i];
            }
            max = currentWindowSum;
            //滑动窗口
            for (int i = 1; i < n; i++) {
                //更新 currentWindowSum：
                //currentWindowSum = currentWindowSum - arr[0] + arr[4]
                //= 30 - 7 + 4 = 27
                currentWindowSum = currentWindowSum - arr[(i-1+n)%n]+arr[(i+3)%n];
                if (currentWindowSum>max){
                    max = currentWindowSum;
                    besStartIndex=i+1;
                }
            }
        }
        System.out.println(max);
        System.out.println(besStartIndex);
        input.close();
    }
}
